package com.zz.ecommerce.declareManage.importB2CDeclareTax.orderManageQdc;

import com.zz.ecommerce.common.GridRequest;
import com.zz.ecommerce.common.GridResult;
import com.zz.ecommerce.common.bean.qdc.db.TOrderHeadQdc;
import com.zz.ecommerce.common.constants.DictConstants;
import com.zz.ecommerce.declareManage.common.service.QdcOrderService;
import com.zz.ecommerce.utils.SessionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpSession;

/**
 * Created by steven on 2016/3/28.
 */
@Controller
@RequestMapping("/importB2cTax/orderManageQdc")
public class QdcIB2cTaxOrderController {

    @Autowired
    private QdcOrderService orderService;

    @RequestMapping("/init")
    public String init() {
        return "declareManage/importB2CDeclareTax/orderManageQdc/index";
    }

    @RequestMapping("/queryOrderList")
    @ResponseBody
    public GridResult queryOrderList(TOrderHeadQdc orderHead, GridRequest request, HttpSession session) {
//        orderHead.setOperId(SessionUtil.getOperator(session));
        orderHead.setOrgId(SessionUtil.getOrganizationId(session));
        orderHead.setIeFlag(DictConstants.IMPORT);
        orderHead.setBusinessType(DictConstants.B2C);
        orderHead.setTradeMode(DictConstants.TRADE_MODE_TAX);
//        orderHead.setIfCreate("0");
        return orderService.queryOrderList(request, orderHead);
    }
}
